package com.ms.education.ucenter.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ms.education.R;
import com.ms.education.ucenter.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ms.education.ucenter.entity.vo.RegisterByPhoneVo;

import java.util.Map;

/**
 * <p>
 * 该表为普通用户，可以访问前台界面 服务类
 * </p>
 *
 * @author ms
 * @since 2023-01-12
 */
public interface UserService extends IService<User> {

    //分页查询
    R pageUser(User user, long current, long limit);

    Integer countRegisterDay(String day);


    void registerByPhone(RegisterByPhoneVo register);

    String loginByPhone(User user);

    User getUserByOpenId(String openid);

    //验证码方式登录
    String loginByCode(User user);

    //用户修改密码
    void updatePassword(String mobile, String newPassword,String code);

    //根据手机号查询用户
    User getUserByMobile(String mobile);

    //回台管理系统获取用户信息
    Map<String, Object> getUserInfo(int parseInt);

    //远程调用班级用户id，并返回分页
    Page<User> pageClassUser(Integer classId, long current, long limit, String name);

    /**
     * 解锁或封禁账户
     * @param userId  用户id
     * @param flag    true 封禁  false  解封
     */
    void untieOrDisableUser(Integer userId, boolean flag);
}
